home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Dots & Pixels / headers / depthChange.h < prev    next >
C/C++ Source or Header  |  1995-09-29  |  1KB  |  40 lines

  1. #pragma once
  2. //
  3. // depthChange is a simple class for temporarily changing the bit depth
  4. // of a monitor.
  5. // It is not fool-proof, but when used as intended no problems are to be
  6. // expected.
  7. // Intended use:
  8. //
  9. //        {
  10. //            depthChange( 2); // switches main monitor to two-bit mode (if present!)
  11. //            //
  12. //            // Code to display a stereogram
  13. //            //
  14. //        } // automagically switches the monitor back to the old depth setting
  15. //
  16. // General warnings:
  17. //
  18. //        foo = new depthChange( 2);
  19. //
  20. // probably is never needed.
  21. //
  22. // The first constructor effectively does nothing. It is there to allow
  23. // subclasses (e.g. fullscreen) to not change the bit depth of the monitor.
  24. //
  25. // Known limitations:
  26. //
  27. //    depthChange can not change the 'grayscale' setting of a graphics device.
  28. //
  29. class depthChange
  30. {
  31.     public:
  32.         depthChange();    // does not actually change depth
  33.         depthChange( int newDepth, GDHandle aGDHandle = GetMainDevice());
  34.         ~depthChange();
  35.         
  36.     private:
  37.         GDHandle theGDHandle;    // zero when no depth change occurred
  38.         const int oldDepth;
  39. };
  40.